package com.hzj.service;

import com.hzj.pojo.OrderInfo;
import com.hzj.pojo.PaymentInfo;
import com.hzj.pojo.RefundInfo;
import com.hzj.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Service
@FeignClient(name = "PROVIDER-ORDER-8003")
public interface OrderInfoService {

    /**
     * 排班编号与就诊人id查询orderinfo的id
     */
    @PostMapping("/atformapi/order/orderInfo/auth/submitOrder/{scheduleId}/{patientId}")
    public Result queryByScheduleIdPatientId(@PathVariable String scheduleId, @PathVariable Long patientId);

    /**
     * 查询订单表
     * @return
     */
    @PostMapping("/atformapi/order/orderInfo/auth/getStatusList")
    public Result queryOrderInfo();


    /**
     * 根据page, limit、searchObj:patientId、orderStatus
     */

    @PostMapping("/atformapi/order/orderInfo/auth/{page}/{limit}")
    public Result queryByPageLimit(@PathVariable int page, @PathVariable int limit, @RequestParam(required = false) Long patientId, @RequestParam(required = false) Integer orderStatus);


     /**
     * 根据id查询
     */
    @PostMapping("/atformapi/order/orderInfo/auth/getOrderInfo/{orderId}")
    public OrderInfo queryById(@PathVariable Long orderId);

    /**
     * 根据id删除
     */
    @PostMapping("/atformapi/order/orderInfo/auth/cancelOrder/{orderId}")
    public Result updateById(@PathVariable Long orderId);

    @PostMapping("/atformapi/order/orderInfo/auth/saveOrderInfo")
    boolean saveOrderInfo(@RequestBody OrderInfo orderInfo);

    @PostMapping("/atformapi/order/orderInfo/auth/updateOrderByHosRecordId")
    boolean updateOrderByHosRecordId(@RequestBody OrderInfo orderInfo);

    /**
     * 修改OR添加支付表
     */
    @PostMapping("/atformapi/order/orderInfo/updatePaymentInfo")
    public Result updatePaymentInfo(@RequestBody PaymentInfo paymentInfo) ;


    /**
     * 删除支付表
     */
    @PostMapping("/atformapi/order/orderInfo/deletePaymentInfo/{outTradeNo}")
    public Result deletePaymentInfo(@PathVariable String outTradeNo) ;

    /**
     * 添加退款表
     */
    @PostMapping("/atformapi/order/orderInfo/updateRefundInfo")
    public Result updateRefundInfo(@RequestBody RefundInfo refundInfo);

}
